package com.yzc.controller;

import com.yzc.model.vo.order.MyOrdersVo;
import com.yzc.result.Result;
import com.yzc.service.TOrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/order")
public class MyOrdersController {

    @Autowired
    private TOrdersService tOrdersService;
    @GetMapping("/loadMyOrdersList")
    public Result<List<MyOrdersVo>> loadMyOrdersList(@RequestParam("id") Integer id) {
        return Result.success(tOrdersService.loadMyOrdersList(id));
    }

    @GetMapping("/accomplishOrder")
    public Result accomplishOrder(@RequestParam("id") Integer id) {
        tOrdersService.accomplishOrder(id);
        return Result.success();
    }
}
